home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / MacPNG Library 1.02 / pngMacSrc 1.02 / PNG Library 0.80 / zLib 0.95 / zconf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-29  |  3.4 KB  |  130 lines  |  [TEXT/ttxt]

  1. /* zconf.h -- configuration of the zlib compression library
  2.  * Copyright (C) 1995 Jean-loup Gailly.
  3.  * For conditions of distribution and use, see copyright notice in zlib.h 
  4.  */
  5.  
  6. /* $Id: zconf.h,v 1.12 1995/05/03 17:27:12 jloup Exp $ */
  7.  
  8. #ifndef _ZCONF_H
  9. #define _ZCONF_H
  10.  
  11. /*
  12.      The library does not install any signal handler. It is recommended to
  13.   add at least a handler for SIGSEGV when decompressing; the library checks
  14.   the consistency of the input data whenever possible but may go nuts
  15.   for some forms of corrupted input.
  16.  */
  17.  
  18. /*
  19.  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  20.  * than 64k bytes at a time (needed on systems with 16-bit int).
  21.  */
  22. #if defined(applec) || defined(__MWERKS__) || defined(THINK_C) || defined(SYMANTEC_C)
  23. #    define MACOS
  24. #endif
  25. #if defined(_GNUC__) && !defined(__32BIT__)
  26. #  define __32BIT__
  27. #endif
  28. #if defined(__MSDOS__) && !defined(MSDOS)
  29. #  define MSDOS
  30. #endif
  31. #if defined(MSDOS) && !defined(__32BIT__)
  32. #  define MAXSEG_64K
  33. #endif
  34. #ifdef MSDOS
  35. #  define UNALIGNED_OK
  36. #endif
  37.  
  38. #ifndef STDC
  39. #  if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus)
  40. #    define STDC
  41. #  endif
  42. #endif
  43.  
  44. #ifndef STDC
  45. #  ifndef const
  46. #    define const
  47. #  endif
  48. #endif
  49.  
  50. #ifdef    __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
  51. #  include <unix.h>
  52. #endif
  53.  
  54. /* Maximum value for memLevel in deflateInit2 */
  55. #ifndef MAX_MEM_LEVEL
  56. #  ifdef MAXSEG_64K
  57. #    define MAX_MEM_LEVEL 8
  58. #  else
  59. #    define MAX_MEM_LEVEL 9
  60. #  endif
  61. #endif
  62.  
  63. /* Maximum value for windowBits in deflateInit2 and inflateInit2 */
  64. #ifndef MAX_WBITS
  65. #  define MAX_WBITS   15 /* 32K LZ77 window */
  66. #endif
  67.  
  68. /* The memory requirements for deflate are (in bytes):
  69.             1 << (windowBits+2)   +  1 << (memLevel+9)
  70.  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
  71.  plus a few kilobytes for small objects. For example, if you want to reduce
  72.  the default memory requirements from 256K to 128K, compile with
  73.      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  74.  Of course this will generally degrade compression (there's no free lunch).
  75.  
  76.    The memory requirements for inflate are (in bytes) 1 << windowBits
  77.  that is, 32K for windowBits=15 (default value) plus a few kilobytes
  78.  for small objects.
  79. */
  80.  
  81.                         /* Type declarations */
  82.  
  83. #ifndef OF /* function prototypes */
  84. #  ifdef STDC
  85. #    define OF(args)  args
  86. #  else
  87. #    define OF(args)  ()
  88. #  endif
  89. #endif
  90.  
  91. /* The following definitions for FAR are needed only for MSDOS mixed
  92.  * model programming (small or medium model with some far allocations).
  93.  * This was tested only with MSC; for other MSDOS compilers you may have
  94.  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
  95.  * just define FAR to be empty.
  96.  */
  97. #if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */
  98. #  ifdef _MSC_VER
  99. #    define FAR __far
  100. #  else
  101. #    define FAR far
  102. #  endif
  103. #endif
  104. #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
  105. #    define FAR __far /* completely untested, just a best guess */
  106. #endif
  107. #ifndef FAR
  108. #   define FAR
  109. #endif
  110.  
  111. typedef unsigned char  Byte;  /* 8 bits */
  112. typedef unsigned int   uInt;  /* 16 bits or more */
  113. typedef unsigned long  uLong; /* 32 bits or more */
  114.  
  115. typedef Byte FAR Bytef;
  116. typedef char FAR charf;
  117. typedef int FAR intf;
  118. typedef uInt FAR uIntf;
  119. typedef uLong FAR uLongf;
  120.  
  121. #ifdef STDC
  122.    typedef void FAR *voidpf;
  123.    typedef void     *voidp;
  124. #else
  125.    typedef Byte FAR *voidpf;
  126.    typedef Byte     *voidp;
  127. #endif
  128.  
  129. #endif /* _ZCONF_H */
  130.